package com.lzw.breezeNovel.webApp.mapper.comic;

import com.lzw.breezeNovel.model.entity.pojo.comic.ComicComment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.mapper.comic
 * @date 2025/3/16
 * @description
 */
@Mapper
@SuppressWarnings("all")
public interface ComicCommentMapper {

    /**
     * 根据书籍id查询评论数量
     * @param comicId
     * @return
     */
    @Select("select count(*) from comic_comment where comic_id = #{comicId}")
    Long selectByComicId(Long comicId);

    /**
     * 根据漫画id查询评论
     * @param comicId
     * @param start
     * @param size
     * @return
     */
    List<ComicComment> selectComicCommentByComicId(Long comicId, Integer start, Integer size);

    /**
     * 保存评论
     * @param comicComment
     */
    void insert(ComicComment comicComment);

}
